// SPA_Data_Types.h : Defines all common SPA self defined data types.
// Author: Heng Belson
//
#ifndef SPA_DATA_TYPES_H
#define SPA_DATA_TYPES_H
//#define _CRT_SECURE_NO_WARNINGS 1
#include <vector>

typedef std::string STRING;
typedef int INTEGER;
typedef bool BOOLEAN;

typedef std::vector<std::string> COLLECTION;

// added by sudhir=====
typedef int PROC_INDEX;
typedef int VAR_INDEX;
typedef int INDEX;

// ====================

// added by achyut----
typedef int STATEMENT_INDEX;
typedef std::vector<STATEMENT_INDEX> STMT_LIST;
typedef std::vector<PROC_INDEX> PROC_LIST;
enum VECTORLIST_TYPE { STMT_VECTOR, PROC_VECTOR};
//------

enum QRYSTATEMENT_TYPE { _ASSIGN, _CALL, _IF, _WHILE, _PROCEDURE, _STMTLIST, _STMT, _VARIABLE, _CONSTANT, _INTEGER, _SYNONYMNS, _INVALID, _BOOLEAN, _EMPTY, _PROGLINE,_UNDERSCORE, _KEYWORDS};
enum LIST_TYPE { USED, MODIFIED};
enum OP_TYPE { OP_Times, OP_Plus, OP_Minus };
enum STATUS { STATUS_Success, STATUS_Failure, STATUS_Not_Processed };
enum NUMERIC_EXPR_TYPE { NUMERIC_EXPR_TYPE_VARIABLE, NUMERIC_EXPR_TYPE_CONSTANT };
enum STATEMENT_TYPE { STATEMENT_Assign, STATEMENT_Call, STATEMENT_If, STATEMENT_While, STATEMENT_Invalid };
enum EXPRESSION_TYPE { EXPRESSION_Times, EXPRESSION_Plus, EXPRESSION_Minus, EXPRESSION_Constant, EXPRESSION_Variable };
enum QueryEntityType { RESULT, SUCHTHAT, WITH, PATTERN, RELATIONSHIP, ARGUMENT, ATTRREF, INTARGUMENT,VARARGUMENT,PROCARGUMENT,STRINGARGUMENT };
enum linkType { CHILD, SIBLING };
enum WITHTYPE { _COMPARISON, _VALUE };
enum ResultType { RESULT_NORMAL, RESULT_BOOLEAN };
enum WITHATTRIBUTE_TYPE {_PROCNAME, _VARNAME, _STMTNO, _PROGLINENO,_CONSTANTVALUE};

enum PatternPos {PATTERN_begin, PATTERN_mid, PATTERN_end,PATTERN_entire};

struct Argument{
	int argument;// QueryStatementType
	int argumentInd;// Index of the variable
	int argumentType;//QRY_STATEMENTTYPE
	int withAttribute;
};

struct PAT_Argument{
	std::string stringArgument;
	//string stringArgument;
	int argumentType;
	int position;
};

struct resultTypes {
	std::vector<std::vector<int>> resultEntity;

};
struct Result{
	std::vector<resultTypes> resultVector;
	bool resultExists;// returns the result for boolean queries
	ResultType resultType; //tells if boolean required or normal
	std::vector<QRYSTATEMENT_TYPE> selectedType;// mapping to qry statement type
	std::vector<int> resultIndex;
	std::vector<WITHATTRIBUTE_TYPE> resultAtrributeType;
	int noOfRows;
};
#endif